﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Forums.SqlServer.Repositories
{
	using System.Collections.Generic;
	using Falcon.Core.Collections;
	using Falcon.Core.SqlServer.Repositories;
	using Falcon.Forums.Domain;
	using Falcon.Forums.Domain.Repositories;
	using Falcon.Forums.SqlServer.Repositories.Parameters;
	using Falcon.Forums.SqlServer.Repositories.Readers;

	public class ForumTopicSubscriptionRepository : SqlRepositoryBase, IForumTopicSubscriptionRepository
	{
		public ForumTopicSubscription GetById(int id)
		{
			return base.GetById(Tables.ForumsTopicsSubscriptions, new ForumTopicSubscriptionSingleReader(), id);
		}

		public ForumTopicSubscription GetBy(ForumTopicSubscriptionSpecification specification)
		{
			return base.GetBy(Tables.ForumsTopicsSubscriptions, new ForumTopicSubscriptionSpecificationParameter(), new ForumTopicSubscriptionSingleReader(), specification);
		}

		public IList<ForumTopicSubscription> GetAll(ForumTopicSubscriptionSpecification specification)
		{
			return base.GetAll(Tables.ForumsTopicsSubscriptions, new ForumTopicSubscriptionSpecificationParameter(), new ForumTopicSubscriptionSingleReader(), specification);
		}

		public IPagedList<ForumTopicSubscription, ForumTopicSubscriptionSpecification> GetPaged(ForumTopicSubscriptionSpecification specification)
		{
			return base.GetPaged(Tables.ForumsTopicsSubscriptions, new ForumTopicSubscriptionSpecificationParameter(), new ForumTopicSubscriptionReader(), specification);
		}

		public ForumTopicSubscription Create()
		{
			return new ForumTopicSubscription();
		}

		public void Insert(ForumTopicSubscription subscription)
		{
			base.Insert(Tables.ForumsTopicsSubscriptions, new ForumTopicSubscriptionParameter(), subscription);
		}

		public void Update(ForumTopicSubscription subscription)
		{
			base.Update(Tables.ForumsTopicsSubscriptions, new ForumTopicSubscriptionParameter(), subscription);
		}

		public void Delete(ForumTopicSubscription subscription)
		{
			base.Delete(Tables.ForumsTopicsSubscriptions, subscription);
		}
	}
}